<h3><?php echo $title; ?></h3>

<?php echo form_open('admin/unit/request'); ?>

<div class="control1">

<?php

	//add button

  echo link_image('admin/unit/create', 'images/admin/button_add.png');

  

  //delete button

  $data = array('name' => 'delete', 'value' => '', 'id' => 'delete');

  echo form_submit($data);

 

  //show field

  $data = array('name' => 'show', 'value' => '', 'id' => 'show');	

  echo form_submit($data);
//$_SESSION['row_number']
  $data = array('name' => 'row_number', 'value' => $_SESSION['row_number'], 'id' => 'show_number');	

  echo form_input($data);

?>

</div><!--control1 end-->
<table class="default">
<?php

	if (is_array($result) )

	{

		//title

		echo '<tr>';

			echo '<th width="50" >';
			echo '&nbsp;',form_checkbox('all'),'&nbsp;All';
		echo '</th>';

      echo '<th width="70">Mã ngành hàng</th>';

	//	echo '<th  width="400">Tên ngành hàng</th>';
		echo '<th  width="250">Tiếng Anh</th>';
		echo '<th  width="250">Tiếng việt</th>';
		

//		echo '<th width="100">Info</th>';

		echo '</tr>';

		

		//print

		foreach ($result as $row)

		{

			echo '<tr>';



			//action

			echo '<td>';

			echo form_checkbox('select_id[]', $row['id']);

			echo '&nbsp;';

			echo anchor('admin/unit/update/'.$row['id'], 'Edit');

			echo '</td>';






      //Code

			echo '<td>';

      echo $row['id'];

			echo '</td>';



			//name
			$name  = unserialize($row['name']);
			
			echo '<td >';

      $vi = html_entity_decode($name['vi'], ENT_QUOTES, 'UTF-8');

      $en = html_entity_decode($name['en'], ENT_QUOTES, 'UTF-8');

			echo $en;

			echo '</td>';			



			//Info

			echo '<td>';
			echo $vi;
		//	echo mailto($row['user_email'], 'Email');

      //echo '&nbsp;'.anchor('#', 'Phone', 'title="'.$row['phone'].'"');

			echo '</td>';

			

			echo '</tr>';

		}

	}

	else

	{

		echo 'Data does not exist';

	}

?>

</table><!--end main content-->



<?php

	echo form_close(); //FORM END

	

	//page
	
	echo '<div class="page">'.$page.'</div>';

?>